var path = require('path'),
    webpack = require('webpack');

module.exports = {
    devtool: '#eval-source-map',
    entry: {
        index: path.resolve(__dirname, 'src/index.js')
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js',
        publicPath: '/dist'
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                loader: 'babel-loader',
                exclude: /node_modules/,
                query: {
                    presets: ['react', 'es2015', 'stage-0']
                }
            },
            {
                test: /\.css$/,
                loader: 'style-loader!css-loader'
            }
        ]
    },
    plugins: [
        new webpack.NoErrorsPlugin()
    ],
    resolve: {
        extensions: ['', '.json', '.js', 'jsx', '.css']
    },
    devServer: {
        contentBase: './dist',
        colors: true,
        hot: true,
        historyApiFallback: true,
        inline: true
    }
};